<div class="panel panel-primary">
    <div class="panel-heading"><p class="text-center"><%= group.name %></p></div>
    <div class="panel-body">
        <!--<span class="label label-primary">简述</span>-->

        <p></p>

        <div class="alert alert-info"><%= group.description %></div>

        <hr>

        <!--<span class="label label-primary">成员</span>-->

        <p></p>
        <div class="members row">
        <% group.users.each do |user| %>
                <div class="col-md-1">
                    <!--<%= link_to user.name, user_path(user), class: "btn btn-info" %>-->
                  <%= render "common/user_icon", user: user %>
                </div>
        <% end %>
        </div>
    </div>
    <div class="panel-footer">
        <div class="row">
            <div class="col-md-2 col-sm-2">
                <% if display != true %>
                    <%= form_tag(group_join_path, method: :post, remote: true) do %>
                        <%= hidden_field_tag "group_id", group.id %>
                        <!--<span class="glyphicon glyphicon-plus-sign" aria-hidden="true"></span>-->
                        <%= submit_tag "Join", class: "btn btn-primary btn-xs" %>
                    <% end %>
                <% else %>
                <% end %>
            </div>
                <div class="col-md-2 col-sm-2 col-md-offset-8">
                    <% if group.owner_id == current_user.id %>
                        <% if !group.lock_tag %>
                            <%= link_to "Lock", lock_group_opt_path(group), class: "btn btn-primary btn-xs" %>
                        <% else %>
                            <%= link_to "Unlock", lock_group_opt_path(group), class: "btn btn-primary btn-xs" %>
                        <% end %>
                    <% else %>
                        <span class="label label-default"><%= !group.lock_tag ? "Locked" : "Unlocked"  %></span>
                    <% end %>
                </div>

        </div>


    </div>
</div>
